<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
<script language="JavaScript">
	var flag=0;
	var timeID;
	function beg(){
		var i=form1.num.value;
		i++;
		form1.num.value=i;
		timeID=setTimeout("beg()",1000);
	}
	function sta(){
		if(flag==0){
			beg();
			flag=1;
		}
	}
	function pau(){
		clearTimeout();
		flag=0;
	}

</script>	
	
	
	
	
	<body>




<form id="form1" name="form1" method="post" action="">

	<input type="text" name="num" size="1" value="0"/>
	<input type="button" name="start" value="开始计时" onclick="sta();" />
	<input type="button" name="pause" value="暂停计时" onclick="pau();" />

</form>




		
		
		
		
		
		
		
		
		
		
		
	</body>
</html>
